package com.atguigu.gmall.activity.redis;

import org.springframework.stereotype.Component;

//redis监听器 接受的消息 自定义的处理实现类
@Component
public class MessageReceive {

    //接收消息  "30:1"
    public void receiveMessage(String message){
        System.out.println("redis监视器"+message);

        String[] split = message.replaceAll("\"","").split(":");//切割
        //将id 和 状态 报寸在本地内存中
        CacheHelper.put(split[0],split[1]);
    }
}
